package chapter3.No3_1_等待和通知机制.c等待通知机制的实现.demo4;

/**
 * Created by Administrator on 2016/11/16.
 */
public class ThreadB extends Thread {
    MyList list;

    public ThreadB(MyList list) {
        this.list = list;
    }

    @Override
    public void run() {
        synchronized (list) {
            try {
                System.out.println("进入B线程");
                list.wait();
                System.out.println("退出B线程");
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
